﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp.拦截器
{
    public static class DBData
    {
        
        /// <summary>
        /// 这里模拟数据库的【订单表】
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<OrderMain> GetOrderMainsDBData()
        {
            for (int i = 1; i < 10; i++)
            {
                yield return new OrderMain() { OrderCode = $"OC_{i}", UserPhone = $"UserPhone_{i}" };
            }
        }

        /// <summary>
        /// 这里模拟数据库的【订单详情表】
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<OrderDetail> GetOrderDetailsDBData()
        {
            for (int i = 1; i < 10; i++)
            {
                yield return new OrderDetail() { Id = 2 * i, OrderCode = $"OC_{i}", Num = 1, SKU = $"SKU_{i % 10}" };
                yield return new OrderDetail() { Id = 2 * i + 1, OrderCode = $"OC_{i}", Num = 1, SKU = $"SKU_{(i + 1) % 10}" };
            }
        }

        /// <summary>
        /// 这里模拟数据库的【产品表】
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Product> GetProductsDBData()
        {
            for (int i = 1; i < 11; i++)
            {
                yield return new Product() { SKU = $"SKU_{i}", Name = $"Name_{i}" };
            }
        }

        /// <summary>
        /// 这里模拟数据库的【电话黑名单表】
        /// </summary>
        /// <returns></returns>

        public static IEnumerable<BlackPhone> GetBlackPhonesDBData()
        {
            for (int i = 1; i < 5; i++)
            {
                yield return new BlackPhone() { UserPhone= $"UserPhone_{i}",Remark="此用户为黑名单用户" };
            }
        }
    }
}
